package com.itehima.File;

import java.io.File;

public class Demo04 {
    public static void main(String[] args) {

        //file中判断功能的方法

        //对一个文件的路径进行判断
        File file = new File("E:ab.txt");
        System.out.println(file.isDirectory());//false
        System.out.println(file.isFile());//true
        System.out.println(file.exists());//true

        File file2 = new File("E:abcd.txt");
        System.out.println(file2.isDirectory());//false
        System.out.println(file2.isFile());//false
        System.out.println(file2.exists());//false

        File file3 = new File("E:\\bbb");
        System.out.println(file3.isDirectory());//true
        System.out.println(file3.isFile());//false
        System.out.println(file3.exists());//true

    }
}
